/*
 * Copyright 2018 the original author or authors.
 * 
 * you can use the file or import project.but Do not take legal responsibility.
 * Only for learning communication.
 *
 * Java compiled version 1.8 or higher
 * 
 * 
 * 
 * 
 */
package org.liang.downimage.util;

import java.io.FileOutputStream;
import java.io.PrintStream;

/**
 * 输出配置，配置标准输出到文件和控制台。<span style="color:red;">此项目中没有用到</span>
 * @author houliang
 * @date 2018年1月27日
 */
public abstract class OutConfig {

	public static void setOutPrint() {
		FileOutputStream propFile = null;
		MultiOutputStream multi = null;

		try {
			propFile = new FileOutputStream("a.txt");
			// 设置同时输出到控制台和prop文件
			multi = new MultiOutputStream(new PrintStream(propFile), System.out);
			System.setOut(new PrintStream(multi));

		} catch (Exception e) {
			// multi.close();
			// propFile.close();
			e.printStackTrace();
		}
	}
	
//	public static void main(String[] args) {
//		setOutPrint();
//		System.out.println("haha");
//	}
}
